<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <h1>一行水平居中，多行居左</h1>
        <div><span>我是多行文字。我是多行文字。我是多行文字。我是多行文字。我是多行文字。我是多行文字。我是多行文字。我是多行文字。我是多行文字。我是多行文字。</span></div>
        <div><span>我是一行文字</span></div>

        <style>
            div {
                text-align: center;
            }
            div span {
                display: inline-block;
                text-align: left;
            }
        </style>
        <h1>遍历A节点的父节点下的所有子节点</h1>
        <div id="a">
            <span>1</span>
            <div>2</div>
            <h3>3</h3>
            <input type="text" />
        </div>
        <script>
            // debugger;
            // <h1>遍历A节点的父节点下的所有子节点</h1>
            var dd = document.getElementById('a');
            console.log(dd);
            var pp = document.getElementById('a').parentNode;
            console.log(pp);
            var b = document.getElementById('a').parentNode.children;
            console.log(b);
            var cc = document.getElementById('a').children;
            console.log(cc);

            new Promise((res) => {
                console.log('pp');
                res();
            }).then(() => {
                console.log('tt');
            });
        </script>
    </body>
</html>
